.org 0xE0214 ; Rain = -1 Vision

	PUSH 	{R4-R5, LR}
	SUB 	SP, SP, 4
	MOV 	R5, R0
	MOV 	R0, R1
	BL 		RainSub1
	MOV 	R4, R0
	MOV 	R0, R5
	BL 		RainSub2
	
	LDR 	R2, [RainPointer1]
	LDR 	R1, [RainPointer2]
	LDR 	R2, [R2, 0]
	LDR 	R1, [R1, 0]
	ADD 	R1, R2, R1, LSL 2
	LDR 	R1, [R1, 0x48]
	LDR 	R1, [R1, 0x1C4]
	LDRB 	R1, [R1, 0x3A]
	
	CMP 	R1, 2 					; Is weather set to rain?
	MOVEQ 	R2, 1					; If yes, -1 vision
	MOVNE 	R2, 0					; If no, no vision reduction
		
	ADD 	R1, R4, R0
	RSB 	R0, R2, 0
	ADD 	R0, R1, R0
	CMP 	R0, 1
	MOVLE 	R0, 1
	ADD 	SP, SP, 4
	POP 	{R4-R5,LR}		
	BX 		LR
	
RainPointer1:
	.dw 0x027C027C

RainPointer2:
	.dw 0x027C0284

;-------------------------------------------------------------------------------
	
.org 0xDFC98
RainSub1:

.org 0xDF7F8
RainSub2:

